package com.cake21.test.webtest.page;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class Login {
	
	WebDriver driver;
	
	/*private static String url = "http://www.21cake.com/passport-login.html";*/

	@FindBy(name="uname")
	private WebElement userInput;
	@FindBy(name="password")
	private WebElement pwdInput;
	@FindBy(id="IDlogin")
	private WebElement loginBtn;
	
	public Login(WebDriver driver) {
		this.driver = driver;
		/*driver.get(url);*/
		PageFactory.initElements(driver, this);
	}
	
	public void enterUser()
	{
		
		this.userInput.sendKeys("18616780773");
	}
	
	public void enterPwd()
	{
		this.pwdInput.sendKeys("888888");
	}
	
	public void pressLoginBtn()
	{
		this.loginBtn.click();
	}
}
